package com.ly.count.user;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ly.count.user.param.CPlusUserPage;
import com.ly.count.user.po.CPlusUser;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.beans.factory.annotation.Autowired;
import com.ly.count.http.CPlusResponse;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestBody;
import com.ly.count.service.user.CPlusUserService;
import org.springframework.web.bind.annotation.RestController;
/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author liaoyong
 * @since 2024-10-03
 */
@RestController
@RequestMapping("/cPlusUser")
@Tag(name = "用户接口")
public class CPlusUserController {
    @Autowired
	@Resource(name="cPlusUserService")
	private CPlusUserService cPlusUserService;
	
	@Operation(summary = "详情")
    @RequestMapping(method = RequestMethod.POST, value = "/detail")
	public CPlusResponse<CPlusUser> detail(@RequestBody CPlusUser cPlusUser){
		return cPlusUserService.selectOne(cPlusUser);
	}
	
	@RequestMapping(method = RequestMethod.POST, value = "/page")
	@Operation(summary = "分页列表")
	public CPlusResponse<Page<CPlusUser>> page(@RequestBody CPlusUserPage cPlusUserPage){
		return cPlusUserService.pageList(cPlusUserPage);
	}
	
	@RequestMapping(method = RequestMethod.POST, value = "/add")
	@Operation(summary = "新增")
	public CPlusResponse<Object> add(@RequestBody CPlusUser cPlusUser){
	   
	   return cPlusUserService.add(cPlusUser);
	}
	@Operation(summary = "编辑")
	@RequestMapping(method = RequestMethod.POST, value = "/modify")
	public CPlusResponse modify(@RequestBody CPlusUser cPlusUser){
	
	   return cPlusUserService.modify(cPlusUser);
	}
	
}

